﻿#pragma once
#ifndef ARD_GENERALREG
#define ARD_GENERALREG

/*
* aarch64 通用快速寄存器
* 1. X0-X31通用寄存器
*	1.1 X0-X7 用于参数传递
*	1.2 X9-X15 在子函数中使用这些寄存器时，直接使用即可, 无需save/restore. 在汇编代码中x9-x15出现的频率极低
*	1.3 X19-X29 在callee子函数中使用这些寄存器时，需要先save这些寄存器，在退出子函数时再resotre
*	1.4 X8： 用于返回结果
*	1.5 X16、X17 ：进程内临时寄存器
*	1.6 X18 ：resrved for ABI
*	1.7 X29 ：FP（frame pointer register）
*	1.8 X30 ：LR
*/
typedef struct _GeneralRegisiter
{
	uint64_t r0;
	uint64_t r1;
	uint64_t r2;
	uint64_t r3;
	uint64_t r4;
	uint64_t r5;
	uint64_t r6;
	uint64_t r7;
	uint64_t r8;
	uint64_t r9;
	uint64_t r10;
	uint64_t r11;
	uint64_t r12;
	uint64_t r13;
	uint64_t r14;
	uint64_t r15;
	uint64_t r16;
	uint64_t r17;
	uint64_t r18;
	uint64_t r19;
	uint64_t r20;
	uint64_t r21;
	uint64_t r22;
	uint64_t r23;
	uint64_t r24;
	uint64_t r25;
	uint64_t r26;
	uint64_t r27;
	uint64_t r28;
	uint64_t r29;
	uint64_t r30;
	uint64_t r31; //Zreos 零寄存器
	_GeneralRegisiter() {
		r0 = 0;
		r1 = 0;
		r2 = 0;
		r3 = 0;
		r4 = 0;
		r5 = 0;
		r6 = 0;
		r7 = 0;
		r8 = 0;
		r9 = 0;
		r10 = 0;
		r11 = 0;
		r12 = 0;
		r13 = 0;
		r14 = 0;
		r15 = 0;
		r16 = 0;
		r17 = 0;
		r18 = 0;
		r19 = 0;
		r20 = 0;
		r21 = 0;
		r22 = 0;
		r23 = 0;
		r24 = 0;
		r25 = 0;
		r26 = 0;
		r27 = 0;
		r28 = 0;
		r29 = 0;
		r30 = 0;
		r31 = 0;
	}
}GeneralRegisiter;

#endif // !ARD_GENERALREG